def testBrackets(text):
    while '()' in text or '[]' in text or '{}' in text or '<>' in text or ' ' in text:
        text = text.replace('()','')
        text = text.replace('[]','')
        text = text.replace('{}','')
        text = text.replace('<>','')
        text = text.replace(' ','')
        
    return not text

a = input('Ввидите скобочную последовательность: ')
print(testBrackets(a )) #True
        
 
 
